home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 102 / examples / ctrlrc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-01-25  |  1.9 KB  |  39 lines

  1. /* Programmer's guide to GEM - 1986 - p.158 -listing 3.2 - CJPurcell Dec'86  */
  2. /* CTRLRC.C  -  MAIN DRIVER for draw_rc()  examples  using Mark Williams C   */
  3. /* to be tested in NDC and/or RC mode with or without GDOS for implications  */
  4. #include <portab.h>                       /* try <> and see ?? */
  5. #include <osbind.h>                       /* system constants  */
  6. #include <gemdefs.h>                      /* GEM-definition    */
  7. /* #include <obdefs.h>                    / * object definition*/
  8.  
  9. WORD contrl[12], intin[128], ptsin[128], intout[128], ptsout[128];
  10.  
  11. #define M_OFF 256
  12. #define RC_COORDS 2
  13. #define RIGHT_ALIGNED 2
  14. #define BOTTOM_ALIGNED 3
  15.  
  16. VOID main()                /* not GEMAIN as in ref. */
  17. {
  18.         WORD handle, work_in[11], work_out[57], max_w, max_h;
  19.         WORD ii;
  20.  
  21.         appl_init();                                    /* init AES for call */
  22.         handle = graf_handle( &ii,&ii,&ii,&ii );        /* get screen handle */
  23.         graf_mouse( M_OFF, NULL );                      /* hide mouse        */
  24.         v_clrwk( handle );                              /* clear workstation */
  25.  
  26.         for( ii=0; ii<11; ++ii ) work_in[ii]=1;         /* init work_in array*/
  27.         work_in[10] = RC_COORDS;                     /* using RC coordinates */
  28.         v_opnvwk( work_in, &handle, work_out );      /* open the workstation */
  29.  
  30.         max_w = work_out[0]; max_h = work_out[1];
  31.         draw_rc( handle,0,0,max_w,max_h );           /* do the examp.routine */
  32.  
  33.         vst_alignment( handle,RIGHT_ALIGNED,BOTTOM_ALIGNED,&ii,&ii );
  34.         v_gtext( handle,max_w,max_h,"Press any Key to Continue" );
  35.         evnt_keybd();                                   /* pause for viewing */
  36.         v_clsvwk( handle );                             /* close workstation */
  37.         appl_exit();                                    /* tell AES finished */
  38. }
  39.